
#include "app_includes.h"

int main(void)
{
    bsp_init();
    
    xTaskCreate( app_create_task, "task_init", 128, NULL, 5, NULL );
	/* Start the scheduler. */
	vTaskStartScheduler();
	/* Will only get here if there was not enough heap space to create the
	idle task. */
    while(1)
    {}
	return 0;
}

void xPortSysTickHandler( void );
void SysTick_Handler( void )
{

    #if (INCLUDE_xTaskGetSchedulerState  == 1 )
      if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
      {
    #endif  /* INCLUDE_xTaskGetSchedulerState */  
        xPortSysTickHandler();
    #if (INCLUDE_xTaskGetSchedulerState  == 1 )
      }
    #endif  /* INCLUDE_xTaskGetSchedulerState */
}


void vApplicationTickHook()
{
    static uint8_t cnt_ms = 0;
	static BaseType_t xHigherPriorityTaskWoken;
    //vcomRxTimeCnt(1);
    lv_tick_inc(1);
    if(app_init_flag)
    {       
        app_timer_task(1);
        BoardTimerTask(1);
        cnt_ms++;
        if(!(cnt_ms&15))
        {
            xSemaphoreGiveFromISR(xSemaphoreSample,&xHigherPriorityTaskWoken);
        }
    }
}
